package com.harmontronics.hanma.paas.paas.domain.app.entity.valueobject;

public enum DataBaseUrlEnum {

    POSTGRES("postgresql", "jdbc:postgresql://"),
    MYSQL("mysql", "jdbc:mysql://"),
    ORACLE("oracle","jdbc:oracle:thin:@"),
    MSSQL("sqlserver","jdbc:sqlserver://");

    private String code;
    private String url;


    private boolean clazzLoaded = false;

    DataBaseUrlEnum(String code, String url) {
        this.code = code;
        this.url = url;
    }



    DataBaseUrlEnum(String code) {
        this.code = code;
    }

    public static DataBaseUrlEnum of(String code) {
        DataBaseUrlEnum result = null;
        for (DataBaseUrlEnum dataBaseUrlEnum : DataBaseUrlEnum.values()) {
            if (dataBaseUrlEnum.getCode().equalsIgnoreCase(code)) {
                result = dataBaseUrlEnum;
                break;
            }
        }
        return result;
    }


    public String getCode() {
        return code;
    }

    public String getUrl() {
        return url;
    }
}
